package com.dotc.patterndemo.simple_factory;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.dotc.patterndemo.R;

/**
 * 简单工厂模式
 */
public class SimpleFactoryActivity extends AppCompatActivity {
    TextView tv_title;
    TextView tv_content;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_simple);
        tv_title = findViewById(R.id.tv_title);
        tv_content = findViewById(R.id.tv_content);
        //标记
        int tag = getIntent().getIntExtra("tag", 0);
        String title = getIntent().getStringExtra("title");
        tv_title.setText(title);
        tv_content.setText("这是一个 " + title);

    }
}
